
function[] = indu(SPM,freq1),
data = load('c:\manoj\projects\induction\Test_01_02h.txt');
%data(1600:end,:) = [];
block = 128;
len = floor(length(data)/block);
int2 = zeros([block,1]);
ext2 = int2;
st = 1;
en = block;
f = fftfrq(block,12);
for i = 1:len,
    
    int1 = fft(data(st:en,1).*hanning(block));
    ext1 = fft(data(st:en,2).*hanning(block));
    int2 = int2 + int1;
    ext2 = ext2 + ext1;
%     hold off;
%     subplot(211);
%     semilogy(f,abs(int1(1:block/2)).^2,'b');
%     hold on;
%     semilogy(freq1,SPM(:,i,1,1),'r*');
%     title('Internal');
%     hold off;
%     subplot(212);
%     semilogy(f,abs(ext1(1:block/2)).^2,'b');
%     hold on;
%     semilogy(freq1,SPM(:,i,2,2),'r*');
%     title('external');
%     fprintf('%d of %d ; ts %d to %d\n',i,block,st,en);
%     pause;
    
st = st+block;
en = en+block;
end;
close;
int2 = int2/len;
ext2 = ext2/len;
    tf =  int2.*conj(ext2)./(ext2.*conj(ext2));
    hold on;
    plot(f,real(tf(1:block/2)),'b');
    hold on;
    plot(f,imag(tf(1:block/2)),'r');
    
    tf1 =  ext2.*conj(int2)./(int2.*conj(int2));
    hold on;
    plot(f,real(tf1(1:block/2)),'k');
    hold on;
    plot(f,imag(tf1(1:block/2)),'g');